package com.zr.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 非常狂躁的猪 on 2019/12/28.
 */
public class CreateDingDan {

    private CreateDingDan() {
    }

    //创建一个空实例对象需要时才赋值
    private  static   CreateDingDan dingDan = null;

    public static synchronized CreateDingDan getDingDan(){
        if (dingDan == null){
            dingDan = new CreateDingDan();
        }
        return dingDan;
    }

    private static Integer count = 0;  //全局自增数

    private static final Integer total = 99; //最多生成多少订单号
    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); //格式化的时间字符串

    //获取当前时间字符串
    public static String getNowDateSdf(){
        return sdf.format(new Date());
    }


}
